package com.py.payment.controller;

import com.py.payment.entity.PySite;
import com.py.payment.service.PySiteService;
import com.py.payment.tools.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/site")
public class SiteController {

    @Autowired
    private PySiteService siteService;

    @PostMapping("/getSiteList")
    public ResponseData getSiteList(){
        List<PySite> siteList = this.siteService.list();
        return ResponseData.success(siteList);
    }
}
